#include<iostream>
#include<unordered_map>
#include<string>

using namespace std;
typedef long long ll;
unordered_map<string,ll> cmz;


int main()
{
	int n;cin>>n;
	while(n--)
	{
		int op;string s;
		cin>>op;
		if(op==1)
		{
			cin>>s;
			ll x;cin>>x;
			cmz[s]=x;
			cout<<"OK"<<endl;
		}
		else if(op==2)
		{
			cin>>s;
			if(cmz.count(s)) cout<<cmz[s]<<endl;
			else cout<<"Not found"<<endl;
		}
		else if(op==3)
		{
			cin>>s;
			if(cmz.count(s))
			{
				cmz.erase(s);
				cout<<"Deleted successfully"<<endl;
			}
			else cout<<"Not found"<<endl;
		}
		else cout<<cmz.size()<<endl;
	}
	return 0;
}